package com.atguigu.cloud.myEnum;

import com.baomidou.mybatisplus.annotation.IEnum;
import lombok.Getter;

@Getter
public enum ReturnCodeEnum implements IEnum<String> {

    /**
     * 成功
     */
    SUCCESS("200", "成功"),

    /**
     * 请求失败
     */
    FAIL("500", "请求失败"),

    /**
     * 数据未找到
     */
    ERR_DATA_NOT_FOUND("9001", "数据未找到"),

    /**
     * 没有权限查看
     */
    ERR_FAIL("9002", "没有权限查看");

    private final String code;
    private final String desc;

    ReturnCodeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    @Override
    public String getValue() {
        return this.code;
    }

    @Override
    public String toString() {
        return this.desc;
    }

}
